<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script type="text/javascript">
				//递归 计算 1-100的和
				// for (var i =0;i<=100;i++){
				// 	sum = sum + i;
				// }
				// document.write("和为:"+sum);
				var sumNumber = 0;//结果
				// var i = 0;//计算位置
				function sum(i){
					document.write("<br>i:"+i);
					i ++;
					sumNumber += i;
					if(i < 100){
						sum(i);
					}
				}
				sum(0);
				document.write("和为:"+sumNumber);
				
				
				
				
			
			
		</script>
	</body>
</html>
